package com.bingfabao.countDown;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/2/25  13:28
 * 描述:
 */
public class countDowanLanuch {

    public static void main(String[] args) throws InterruptedException {

        List<String> list=new ArrayList<>();


        CountDownLatch countDownLatch=new CountDownLatch(5);

        MyCountDown myCountDown1 = new MyCountDown(countDownLatch);

        MyCountDown myCountDown2 = new MyCountDown(countDownLatch);
        MyCountDown myCountDown3 = new MyCountDown(countDownLatch);
        MyCountDown myCountDown4 = new MyCountDown(countDownLatch);

        Thread thread=new Thread(myCountDown1,"A-");
        thread.start();


        countDownLatch.await();


        //获取每个线程的执行结果




/*
        for (int i=0;i<5;i++){
            Thread thread=new Thread(new MyCountDown(countDownLatch),"A-"+i);
            thread.start();
        }*/

        countDownLatch.await();

        System.out.println("======走出发-去玩======");

    }

}
